package net.yunxinyong.cec.controller;

import com.itextpdf.text.pdf.AcroFields;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfReader;
import com.itextpdf.text.pdf.PdfStamper;
import net.yunxinyong.cec.service.PdfInfoService;
import net.yunxinyong.cec.utils.DownLoadUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;

@RequestMapping("downLoad")
@RestController
public class FilesDownloadController {

    @Autowired
    private PdfInfoService pdfInfoService;
    @RequestMapping(value = {"/download"})
    public String exportPdf(HttpServletResponse response,@RequestParam("id")long id) throws UnsupportedEncodingException {
        pdfInfoService.selectById(response,id);

        return null;
    }
}
